package paskal.audio.player;

import java.io.File;
import java.io.InputStream;
import java.net.URL;

/**
 * This interface defines player controls available.
 */
public interface Controller {
	/**
	 * Open inputstream to play.
	 * 
	 * @param in
	 * @throws PlayerException
	 */
	public void open(InputStream in) throws PlayerException;

	/**
	 * Open file to play.
	 * 
	 * @param file
	 * @throws PlayerException
	 */
	public void open(File file) throws PlayerException;

	/**
	 * Open URL to play.
	 * 
	 * @param url
	 * @throws PlayerException
	 */
	public void open(URL url) throws PlayerException;

	/**
	 * Set position.
	 * 
	 * @param percent
	 * @throws PlayerException
	 */
	public void setPercentagePosition(double p) throws PlayerException;

	/**
	 * Start playback.
	 * 
	 * @throws PlayerException
	 */
	public void play() throws PlayerException;

	/**
	 * Stop playback.
	 * 
	 * @throws PlayerException
	 */
	public void stop() throws PlayerException;

	/**
	 * Pause playback.
	 * 
	 * @throws PlayerException
	 */
	public void pause() throws PlayerException;

	/**
	 * Resume playback.
	 * 
	 * @throws PlayerException
	 */
	public void resume() throws PlayerException;

	/**
	 * Sets Volume value. Linear scale 0.0 <--> 1.0
	 * 
	 * @param gain
	 *            value from 0.0 to 1.0
	 * @throws PlayerException
	 */
	public void setVolume(float volume) throws PlayerException;
}